#ifndef DECODER_H
#define DECODER_H

#include <string>
using namespace std;

/* Decoder Status */
enum DECStatus{
	DECODER_ERR, DECODER_IDLE, DECODER_STOP, DECODER_PLAY, DECODER_QUIT
};

/**
 * @brief The decoder interface
 *
 * Functions must be implemented:
 *     - Basic Operations:
 *         - open(), play(), pause(), resume(), stop()
 *     - Toggle of Fullscreen: fullscreen_sw()
 *     - Supplemental Functions:
 *         - file_filter(), getStatus(), getMediaLength(), getMediaInfo(),
 *           getCurrentPos()
 *
 */
class Decoder{

public:
	virtual ~Decoder(){};

	/* **************** */
	/* Basic Operations */
	/* **************** */
	/*   Return a value<0 for a fatal error */
	virtual int open(const string fileName) = 0;
	virtual int play(const unsigned int msec ) = 0;
	virtual int pause() = 0;
	virtual int resume() = 0;
	virtual int stop() = 0;

	/* ******************** */
	/* Switch of fullscreen */
	/* ******************** */
	/*   Return a value<0 for a fatal error */
	virtual int fullscreen_sw() = 0;

	/* ********************** */
	/* Supplemental Functions */
	/* ********************** */
	/* file_filter() returns a string of filter
	 * in format like "*.avi *wmv" */
	virtual const string file_filter() const = 0;
	/* Return the decoder status: IDLE, STOP, PLAY or QUIT .*/
	virtual DECStatus getStatus() const = 0;
	/* Return the length of the media file. (in milliseconds) */
	virtual int getMediaLength() const = 0;
	/* Return the current playback position. (in milliseconds) */
	virtual int getCurrentPos() const = 0;
	/* Return information about the media file.
	 * NOTE: The content of the information depends on the decoder. */
	virtual const string getMediaInfo() const = 0;
};

#endif
